package com.itheima.demo.demo05;

import java.lang.Thread;
import java.util.Collection;

public class xianCheng2 {
    public static void main(String[] args) {
        new method03().start();
        new method01().start();
        new method02().start();



        /*创建三个子线程，在每个线程中开启10万次的循环，线程1循环中将循环自增变量
        i赋值给Integer类型变量 a，
        线程2循环中将字符串"黑马程序员"赋值给String类型变量b,
        线程3循环中将字符串"黑马程序员"和循环自增变量i拼接后赋值给String类型变量c*/
    }

    public static class method03 extends Thread {
        @Override
        public void run() {
            long A = System.currentTimeMillis();
            Integer a=0;
            for (int i = 0; i <100000 ; i++) {
                a++;

            }
            long B = System.currentTimeMillis();
            System.out.println(B-A);
        }


    }

    public static class method02 extends Thread  {
        @Override
        public void run() {
            long A = System.currentTimeMillis();
            ;
            for (int i = 0; i <100000 ; i++) {
                String a="黑马程序员";
            }
            long B = System.currentTimeMillis();
            System.out.println(B-A);
        }



    }

  public static class method01 extends Thread{
      @Override
      public void run() {
          long A = System.currentTimeMillis();
          Integer a=0;
          String b="黑马程序员";
          for (int i = 0; i <100000 ; i++) {
              a++;

          }
          long B = System.currentTimeMillis();
          System.out.println(B-A);

      }


    }
}
